<#include "/layout/_layout.ftl" />
<@head title="首页|四眼井|互联网人的乐园 ">
<link href="${static_domain}/js/areaselect/areaselect.min.css" type="text/css" rel="stylesheet"/>
</@head> <@body 5>
<div class="clearfix">
	<div class="breadcrumbs"><i class="icon-home"></i>首页>招聘</div>
	<div class="ui-grid-19">
		<div class="mgl-20">
			<div class="ui-box">
				<div class="ui-box-title">
					<h3>职位搜索</h3>
				</div>
				<div class="ui-box-content">
					<fieldset>
						<div class="ui-form-item">
							<label for class="ui-label">搜索职位：</label>
							<input type="text" name="name" class="ui-input" id="query">
							<input type="button" class="btn-g blue" value="搜索" id="search_btn">
						</div>
						<div class="ui-form-item">
							<label class="ui-label">职位类别：</label>
							<select class="ui-select" name="type" id="job_type">
								<option value="-1">请选择</option>
							</select>
						</div>

						<div class="ui-form-item">
							<label class="ui-label"><span class="label">工作省市：</span></label>
							<span id="area"></span>
						</div>

						<!--<div class="ui-form-item">
							<label class="ui-label">基本薪水：</label>
							<select id="" class="ui-select" name="salary">
							<option value="">请选择职位月薪</option>
							<option value="0000001000">1000元以下</option>
							<option value="0100002000">1000-2000元</option>
							<option value="0200104000">2001-4000元</option>
							<option value="0400106000">4001-6000元</option>
							<option value="0600108000">6001-8000元</option>
							<option value="0800110000">8001-10000元</option>
							<option value="1000115000">10001-15000元</option>
							<option value="1500125000">15000-25000元</option>
							<option value="2500199999">25000元以上</option>
						</select>
						</div>-->
					</fieldset>
				</div>
			</div>
			<div id="job_list"></div>
		</div>
	</div>
	<aside class="ui-grid-6">
		<div>
			<a href="/job/add" class="box-btn">我要招聘</a>
			<a href="#" class="box-btn">我要求职</a>
		</div>
	</aside>
	<div class="ui-grid-6">
		<div class="ui-box">
			<div class="ui-box-content">
				<i class="icon-briefcase"></i>&nbsp;
				<a href="job/my">我申请的工作</a>
				<br/>
				<i class="icon-edit"></i>&nbsp;
				<a href="/job/resume">我的简历</a>
			</div>
		</div>
	</div>
	<div id="hot_job" class="ui-grid-6">

	</div>
	<div id="" class="ui-grid-6"></div>
</div>

</@body>
<@script>
<script src="${static_domain}/js/areaselect/area.min.js"></script>
<script>
	$(function () {
		$('#hot_job').load('/job/hot');
		$('#area').area(['province', 'city', 'district']);
		$.get('/job/type', function (data) {
			$.each(data.type, function (n, d) {
				$('#job_type').append('<option value="' + d.id + '">' + d.name + '</option>')
			})
		});
		var loadList = function (page) {
			var url = '/job/list?page=' + page;
			if ($('#query').val().trim() != '') {
				url += '&q=' + $('#query').val().trim();
			}
			if ($('#job_type').val() > -1) {
				url += '&type=' + $('#job_type').val();
			}
			if ($('select[name="province"]').val() > 0) {
				if ($('select[name="city"]').val() > 0) {
					if ($('select[name="district"]').val() > 0) {
						url += '&area=' + $('select[name="district"]').val();
					} else {
						url += '&area=' + $('select[name="city"]').val();
					}
				} else {
					url += '&area=' + $('select[name="province"]').val();
				}
			}
			$('#job_list').load(url);
		};
		loadList(1);
		$('select[name="province"],select[name="city"],select[name="district"],' +
				'#job_type').change(function () {
			loadList(1);
		});
		$('#search_btn').click(function () {
			loadList(1);
		});
		window.loadList = loadList;
	});
</script>
</@script>